/* TableDemo4.java 
* Created on Dec 19, 2012 
* Author:Mr.Viet
* Phone: 01683430426
* Email: phamvanvietcdhd@gmail.com
*/ 
package com.session5; 

import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.table.TableColumn;

public class TableDemo4 extends AbstracFrame{
	private JTable tblStudent;
	private MyData model;
	public TableDemo4() {
		this.model = new MyData();
	}
	public static void main(String[] args) {
		TableDemo4 f = new TableDemo4();
		f.createForm();
		f.showForm();
	}
	@Override
	public void createForm() {
		this.tblStudent = new JTable(this.model);
		TableColumn ageColumn = this.tblStudent.getColumnModel().getColumn(2);
		TableColumn nameColumn = this.tblStudent.getColumnModel().getColumn(0);
		TableColumn addrColumn = this.tblStudent.getColumnModel().getColumn(1);
		
		ageColumn.setCellRenderer(new AgeLabel());
		this.getContentPane().add(new JScrollPane(this.tblStudent));
		ageColumn.setPreferredWidth(5);
		nameColumn.setPreferredWidth(70);
		addrColumn.setPreferredWidth(200);
		//Dang Ki Su Kien
//		this.tblStudent.
	}
	
}
